Load order by entity_id magento 2

36

Load order by entity_id magento 2 -

protected $orderRepository;

public function __construct(
    \Magento\Sales\Api\OrderRepositoryInterface $orderRepository
){
    $this->orderRepository = $orderRepository;
}
$order = $this->orderRepository->get($orderId);
$orderIncrementId = $order->getIncrementId(); // To get order incremental id

Comments

Submit
0 Comments